package com.example.demo.NiuKe.v15;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws IOException {
        checkQQ();
    }


    public static boolean checkQQ() throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str = br.readLine();
        if(str.length()>15 || str.length()<5){
            return false;
        }
        for (int i =0;i<str.length();i++){
            int j = str.charAt(i)-'0';
            if(j==0 && i==0){

                return false;
            }
             if(j>9){
                 return false;
             }
            }
        return true;
        }
    }

